package com.jade.store.wechat.biz.service.auth;

import com.jade.store.wechat.biz.common.WxConstantUtil;
import com.jade.store.wechat.biz.service.BaseService;
import org.apache.commons.lang3.StringUtils;

/**
 * 基础服务
 * User: jinya
 * Date: 2016/12/13
 * Time: 14:29
 * TEL :17701640710   MAIL:2009_jinya@163.com
 * To change this template use File | Settings | File Templates.
 */
public class BaseAccessTokenService extends BaseService {
    private ApiComponentTokenService apiComponentTokenService=new ApiComponentTokenService();
    //API的地址
    private String apiURL;
    public BaseAccessTokenService(String api) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
       super(api);
        try {
            String token=apiComponentTokenService.getAccessToken();
            if(StringUtils.isNotEmpty(token)){
                String newApiUrl=String.format(api,token);
                super.setApiURL(newApiUrl);
            }
        }catch (Exception e){}

    }
}
